<table class="box-vang5" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr class="light">
          <td class="text-top">.:. Dự án chờ</td>
        </tr>
      </tbody></table>
      <table class="box-vang5" cellpadding="0" cellspacing="0" width="100%">
        <tbody><tr class="light">
          <td class="t-l"></td>
          <td class="t-c"></td>
          <td class="t-r"></td>
        </tr>
        <tr class="light">
          <td class="c-l"></td>
          <td class="c-c" valign="top">
         
<div class="clear" style="height:10px"></div>

<?php 
	$user=$_SESSION['userid'];
	$name=$_SESSION['name'];
	$sql2=mysql_query(" select 
							tb_task.task_id,
							tb_task.task_name,
							tb_task.contract_start,
							tb_task.contract_end,
							tb_task.level as mucdo,
							tb_task.brief,
							tb_task.file_attach,
							tb_task.nguoinhan,
							tb_task.date_creative,
							tb_task.status,
							tb_task.duyet,
							tb_task.nguoitiepnhan,
							tb_account_admin.account_name 
						from 
							tb_task
							inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
						
						where (nguoinhan='$user' or nguoitheodoi like '%$name%') and (status=0 or status=1) and (duyet=0 or duyet=2)
						order by task_id desc
					");
	
?>
<table id="box-quick" class="box-quick" border="0" cellpadding="5" cellspacing="0" width="100%">
          <tbody><tr id="title">
            <td width="5%">Mã </td>
            <td width="30%">Tên dự án</td>
            <td width="10%">Mức độ ưu tiên</td>
            <td width="10%">Ngày bắt đầu</td>
            <td width="10%">Ngày kết thúc</td>
            <td width="10%">Ngày gửi dự án</td>
            <td width="10%">Giao cho </td>
            <td width="15%">Trạng thái</td>
          </tr>
         <?php 
		 	while($row=mysql_fetch_array($sql2))
			{
				
		 ?>
           <tr class="light" id="value" style="cursor:pointer;" onmouseover="mouse_den(this)" onmouseout="mouse_di(this)" bgcolor="">
            <td style="border-left:1px solid #ccc"><div align="center"><?php echo $row['task_id'];?></div></td>
          
            <td  class="tdbg_2" onclick="window.open('index.php?tn=task_detail&id=<?php echo $row['task_id'];?>','_self');"><div align="left">&nbsp;<span title="<?php echo $row['task_name'];?>">
				<?php echo $row['task_name'];?>
                 </span>
                </div>
            </td>
           
            <td>
            	<div align="center" style="color:#090;">
					<?php if($row['mucdo']==1){echo 'Thấp';}?>
                    <?php if($row['mucdo']==2){echo 'Trung bình';}?>
                    <?php if($row['mucdo']==3){echo 'Cao';}?>
            	</div>
            </td>
            <td align="center"> <?php echo date('d-m-Y',$row['contract_start']);?></td>
            <td align="center"> <?php echo date('d-m-Y',$row['contract_end']);?></td>
             <td><div align="center">&nbsp;<?php echo date('d-m-Y H:i',$row['date_creative']);?></div></td>
             <td align="center"><?php echo $row['account_name'];?> </td>
             <td align="center" style="color:#f00">
					<?php if($row['status']==0) {echo 'Chờ xử lý';}?>
                	<?php if($row['status']==1) {echo $row['nguoitiepnhan'];}?>
                    <?php if($row['duyet']==2) {echo 'Chờ duyệt';}?>
             </td>
          </tr>
          
         <?php }?>
         
          
        </tbody></table>
        
        <!-- cong viec phat sinh -->
         <div class="clear" style="height:20px"></div>
   <?php if($_SESSION['level']==2 or $_SESSION['level']==3){?>
          <table id="box-quick" class="box-quick" border="0" cellpadding="5" cellspacing="0" width="100%">
          <tbody>
 
          <tr><td colspan="10"><strong style="text-transform:uppercase">Công việc phát sinh</strong></td></tr>
          <tr id="title">
            <td width="5%">Mã </td>
         
            <td width="20%">Tên dự án</td>
            <td width="10%">Mức độ ưu tiên</td>
            <td width="10%">Ngày bắt đầu</td>
            <td width="10%">Ngày kết thúc</td>
            <td width="10%">Ngày đăng ký</td>
            <td width="10%">Người đăng ký </td>
            <td width="10%">Tình trạng</td>
          </tr>
          <?php $sqlphatsinh=mysql_query("
		  								select 
											tb_task.task_id,
											tb_task.task_name,
											tb_task.contract_start,
											tb_task.contract_end,
											tb_task.level as mucdo,
											tb_task.brief,
											tb_task.file_attach,
											tb_task.nguoinhan,
											tb_task.date_creative,
											tb_task.status,
											tb_task.duyet,
											tb_task.nguoiduyet,
											tb_account_admin.account_name 
										from 
											tb_task 
											inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
										where nguoiduyet='$user' and status=1 and (duyet=2 or duyet=3)");
		  	while($rsphatsinh=mysql_fetch_array($sqlphatsinh))
			{
		  ?>
          <tr class="light" id="value">
            <td style="border-left:1px solid #ccc"><div align="center"><?php echo $rsphatsinh['task_id']?></div></td>
          
            <td onclick="window.open('index.php?tn=task_detail&id=<?php echo $rsphatsinh['task_id'];?>','_self');" style="cursor:pointer">
            <span style="color:#f00">
				<?php echo $rsphatsinh['task_name'];?>
                 </span>
                
            </td>
           
            <td>
                <div align="center" style="color:#090;">
                	<?php if($rsphatsinh['mucdo']==1){echo 'Thấp';}?>
                    <?php if($rsphatsinh['mucdo']==2){echo 'Trung bình';}?>
                    <?php if($rsphatsinh['mucdo']==3){echo 'Cao';}?>
                </div>
            </td>
            <td align="center"><?php echo date('d-m-Y',$rsphatsinh['contract_start']);?></td>
             <td align="center"><?php echo date('d-m-Y',$rsphatsinh['contract_end']);?></td>
             <td align="center"> <?php echo date('d-m-Y H:i',$rsphatsinh['date_creative']);?></td>
             <td align="center"><?php echo $rsphatsinh['account_name'];?> </td>
             <td align="center" style="cursor:pointer"> 
             <?php if($rsphatsinh['duyet']==2){?><a onclick="window.open('index.php?tn=duyet_phatsinh&id=<?php echo $rsphatsinh['task_id'];?>','_self');"> <img src="images/dongy.jpg" /> </a><?php }?>
             <?php if($rsphatsinh['duyet']==3){echo '<b> Đã duyệt</b>';}?>
             </td>
          </tr>
          <?php }?>
        </tbody>
        </table>
		<?php }?>
 <td class="c-r"></td>
        </tr>
        <tr class="light">
          <td class="b-l"></td>
          <td class="b-c"></td>
          <td class="b-r"></td>
        </tr>
      </tbody></table>